package com.homework.homework1;

import java.util.ArrayList;
import java.util.Collection;

public class Test01 {
    public static void main(String[] args) {
        //多态 父类指向子类
        Collection<String> list=new ArrayList<>();
        System.out.println("欢迎来到王者荣耀，情根据阵容选择英雄");
        list.add("安琪拉");
        list.add("蔡文姬");
        list.add("王昭君");
        list.add("貂蝉");
        list.add("妲己");//玩集合添加元素
        System.out.println("可选英雄有:"+list);
        System.out.println("召唤师1选择蔡文姬:"+list.contains("蔡文姬"));
        System.out.println("将蔡文姬从集合移除"+list.remove("蔡文姬"));
        System.out.println("召唤师2选择王昭君:"+list.contains("王昭君"));
        System.out.println("将王昭君从集合移除"+list.remove("王昭君"));
        System.out.println("召唤师3选择貂蝉:"+list.contains("貂蝉"));
        System.out.println("将貂蝉从集合移除"+list.remove("貂蝉"));
        System.out.println("剩余可选英雄:"+list);
        list.clear();//清空集合
        if(list.isEmpty()==true){
            System.out.println("召唤师已选择完毕,可选英雄为空");
        }
    }
}
